package com.jason.common.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

public interface TransAtmoMaper{
    @Insert("insert into t_trans_atmo(global_id,branch_id,status,busi_time) values(#{globalId},#{branchId},0,sysdate())")
    public void insertTransAtmo(String globalId,Long branchId);

    @Update("update t_trans_atmo set status = 1 where global_id=#{globalId} and branch_id = #{branchId} and status = 0")
    public int updateConfirmTransAtmo(String globalId,Long branchId);

    @Update("update t_trans_atmo set status = 2 where global_id=#{globalId} and branch_id = #{branchId} and status = 0")
    public int updateCancelTransAtmo(String globalId,Long branchId);

    @Select("select count(*) from t_trans_atmo where global_id=#{globalId} and branch_id = #{branchId} and status = 0")
    public int selectIfExist(String globalId,Long branchId);
}
